# 设置最低CMake版本要求
cmake_minimum_required(VERSION 3.10)

# 项目名称
project(Question3)

# 设置 C++ 标准
set(CMAKE_CXX_STANDARD 17)

# 查找 OpenMP 库
find_package(OpenMP REQUIRED)

# 添加源文件
add_executable(convert convert.cpp)

# 启用 OpenMP 支持
target_link_libraries(convert PRIVATE OpenMP::OpenMP_CXX)

if (CMAKE_BUILD_TYPE STREQUAL "Debug")
    target_compile_options(convert PRIVATE /RTC1 /Od ${OpenMP_CXX_FLAGS})
elseif (CMAKE_BUILD_TYPE STREQUAL "Release")
    target_compile_options(convert PRIVATE /O2 ${OpenMP_CXX_FLAGS})
endif()

# 设置可执行文件输出目录为 bin 文件夹
set_target_properties(convert PROPERTIES
    RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)

# 清理目标
set_directory_properties(PROPERTIES CLEAN_NO_CUSTOM 1)
